package com.teach.config;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(ignoreInvalidFields = true,ignoreUnknownFields = true,prefix = "com.teach")
public class Config {
	
	/**
	 * - 是否为开发模式
	 */
	public Boolean dev=false;
	
	/**
	 * - 系统名称
	 */
	public String systemName = "默认系统名称";
	

	/**
	 * - 分布式ID节点编号
	 */
	public Long workerId = 0L;
	/**
	 * - 分布式ID数据中心编号
	 */
	public Long dataCenterId = 0L;

	/**
	 * - 短信默认超时
	 */
	public Long smsCacheDefaultTime = 60000L;
	
	/**
	 * - SmsChinese.com短信接口配置
	 */
	public SmsChinese smsChinese = new SmsChinese();
	
	/**
	 * - 注册时的默认用户值
	 */
	public User defaultUser=new User();
	
	
	


	public Boolean getDev() {
		return dev;
	}


	public void setDev(Boolean dev) {
		this.dev = dev;
	}
	
	


	public Long getWorkerId() {
		return workerId;
	}


	public void setWorkerId(Long workerId) {
		this.workerId = workerId;
	}


	public Long getDataCenterId() {
		return dataCenterId;
	}


	public void setDataCenterId(Long dataCenterId) {
		this.dataCenterId = dataCenterId;
	}


	public Long getSmsCacheDefaultTime() {
		return smsCacheDefaultTime;
	}


	public void setSmsCacheDefaultTime(Long smsCacheDefaultTime) {
		this.smsCacheDefaultTime = smsCacheDefaultTime;
	}


	public SmsChinese getSmsChinese() {
		return smsChinese;
	}


	public void setSmsChinese(SmsChinese smsChinese) {
		this.smsChinese = smsChinese;
	}


	public User getDefaultUser() {
		return defaultUser;
	}


	public void setDefaultUser(User defaultUser) {
		this.defaultUser = defaultUser;
	}


	public static class SmsChinese{
		
		public String api = "http://utf8.api.smschinese.cn";
		public Map<String, String> headers = new HashMap<>();
		public String uid = "suiyige";
		public String key = "d41d8cd98f00b204e980";
		public String message = "验证码：%s 【五车教育】";
		
		{
			headers.put("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
		}
		
		public String getApi() {
			return api;
		}
		public void setApi(String api) {
			this.api = api;
		}
		public Map<String, String> getHeaders() {
			return headers;
		}
		public void setHeaders(Map<String, String> headers) {
			this.headers = headers;
		}
		public String getUid() {
			return uid;
		}
		public void setUid(String uid) {
			this.uid = uid;
		}
		public String getKey() {
			return key;
		}
		public void setKey(String key) {
			this.key = key;
		}
		public String getMessage() {
			return message;
		}
		public void setMessage(String message) {
			this.message = message;
		}
		
		
		
		
	}
	

	/**
	 * <pre>
	 * - 默认用户值
	 * ClassName : com.teach.config.User
	 * Author : J.L.Zhou
	 * Tel : 151 1104 7708
	 * E-Mail : 2233875735@qq.com
	 * Date : 2020-10-19 9:27:48
	 * Version : 1.0
	 * Copyright 2020 jlzhou.top Inc. All rights reserved. 
	 * Warning: this content is only for internal circulation of the company. It is forbidden to divulge it or use it for other commercial purposes
	 * </pre>
	 *
	 */
	public static class User {
	    /**
	     * 角色编号,默认:2=普通用户
	     */
	    private Integer roleId = 2;
	    /**
	     * 用户状态
		 *             默认：1=锁定，
		 *             0 - 正常
		 *             1 - 锁定
		 *             n - 更多
	     */
	    private Integer userStatus = 1;



		public Integer getRoleId() {
			return roleId;
		}

		public void setRoleId(Integer roleId) {
			this.roleId = roleId;
		}

		public Integer getUserStatus() {
			return userStatus;
		}

		public void setUserStatus(Integer userStatus) {
			this.userStatus = userStatus;
		}

		/**
		 * - 用户注册时间,当前系统时间
		 * @return
		 */
		public java.util.Date getUserRegTime() {
			return new Date();
		}
 
	}
}
